﻿using System;
using System.Threading.Tasks;
using AspectCore.DynamicProxy;

namespace Aop_AspectCore.Core
{
    class Program
    {
        static void Main(string[] args)
        {
            // AOPDemo();
            AOPHystrixJianji();
            Console.ReadKey();
        }

        public static void AOPDemo()
        {
            ProxyGeneratorBuilder proxyGeneratorBuilder = new ProxyGeneratorBuilder();
            using (IProxyGenerator proxyGenerator = proxyGeneratorBuilder.Build())
            {
                Person p = proxyGenerator.CreateClassProxy<Person>();
                p.Say("rupeng.com");
            }
        }


        public static void AOPHystrixJianji()
        {
            ProxyGeneratorBuilder proxyGeneratorBuilder = new ProxyGeneratorBuilder();
            using (IProxyGenerator proxyGenerator = proxyGeneratorBuilder.Build())
            {
                Person p = proxyGenerator.CreateClassProxy<Person>();
                Console.WriteLine(p.HelloAsync("云展测试").Result);
            }

        }




    }
}
